package com.dg.gdx.screens;

import com.badlogic.gdx.Game;
import com.dg.gdx.screens.listeners.SplashListener;

public class SplashScreen extends AbstractScreen {


	private float screenTime;
	private float time;
	
	private boolean isTimeOver;
	
	private SplashListener splashListener;
	
	public SplashScreen(Game game, float screenTime) {
		super(game);
		this.screenTime = screenTime;
	}
	
	@Override
	public void render(float delta) {
		time = time + delta;
		if (time > screenTime && !isTimeOver()){
			isTimeOver = true;
			if (splashListener != null){
				splashListener.onTimeOver();
			}
		}

	}

	public SplashListener getSplashListener() {
		return splashListener;
	}

	public void setSplashListener(SplashListener splashListener) {
		this.splashListener = splashListener;
	}

	public float getScreenTime() {
		return screenTime;
	}

	public void setScreenTime(float screenTime) {
		this.screenTime = screenTime;
	}

	public boolean isTimeOver() {
		return isTimeOver;
	}

	public void setTimeOver(boolean isTimeOver) {
		this.isTimeOver = isTimeOver;
	}

}
